package com.aaa.demo3.controller;


import com.aaa.demo3.entity.AliPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class Hellocontroller {
    @GetMapping("/hello")
    public Map<String,Object> hello(){
        Map<String,Object> map = new HashMap<>();
        map.put("name","吴义松");
        map.put("age",16);
        return map;
    }

    @Autowired
    private AliPay aliPay;
    @GetMapping("/index")
    public AliPay index(){
        return aliPay;
    }

    @Value("${server.port}")
    private Integer port;

    @GetMapping("info")
    public String info(){
        return "服务器的端口号"+port;
    }
}
